package com.dajie.pt.dao;

import java.util.List;

import org.springframework.stereotype.Component;

import com.dajie.pt.dao.base.BaseIbatisDao;
import com.dajie.pt.model.AuditBlacklist;

/**
 * AuditBlacklist DAO.
 */
@Component
public class BlacklistDao extends BaseIbatisDao<AuditBlacklist, Long>
{

	@Override
	protected Class getEntityClass()
	{
		return AuditBlacklist.class;
	}

	public boolean isInBlacklist(String name)
	{
		return super.findUniqueBy("name", name) != null;
	}

	public List<String> getAllBlackNames()
	{
		return getAllByPage("AuditBlacklist.getAllBlackNames", map());
	}

	public int getCount()
	{
		return (Integer) db().queryForObject("AuditBlacklist.getCount");
	}

}